// an array--collection of values, all of which are of the same type
var aArray = new Array( 5 );


for( var i = 0; i < aArray.length; i = i + 1 )
{
	aArray[ i ] = 0;
}

/*
aArray[ 0 ] = 0;	// China
aArray[ 1 ] = 0;	// Japan
aArray[ 2 ] = 0;	// Mongolia
aArray[ 3 ] = 0;	// South Korea
aArray[ 4 ] = 0;	// Taiwan
*/

function showImage( nIndex )
{
	aArray[ nIndex ] = aArray[ nIndex ] + 1;
}




function showChina()
{
	aArray[ 0 ] = aArray[ 0 ] + 1;
				//alert( "SHOW PICTURES OF CHINA" );
				
				// go through the HTML document, get the element (aka the tag
				// that has the id="picture" and change the src, alt, and
				// title attributes.
				
				document.getElementById( "picture" ).src = "images/china_1.jpg";
				document.getElementById( "picture2" ).src = "images/china_2.jpg";
				document.getElementById( "picture" ).alt = "These are pictures of China.";	
				document.getElementById( "picture" ).title = "These are pictures of China.";				
			
				document.getElementById( "caption" ).innerHTML = "China - Where everything is made and their nation's flag.";
}

function showJapan()
{
	aArray[ 1 ] = aArray[ 1 ] + 1;
	
				document.getElementById( "picture" ).src = "images/Japan_1.jpg";
				document.getElementById( "picture2" ).src = "images/Japan_2.jpg";
				document.getElementById( "picture" ).alt = "These are pictures of Japan.";	
				document.getElementById( "picture" ).title = "These are pictures of Japan.";				
			
				document.getElementById( "caption" ).innerHTML = "Japan - Land of the rising sun and their nation's flag.";
	
}

function showMongolia()
{
	aArray[ 2 ] = aArray[ 2 ] + 1;
	
				document.getElementById( "picture" ).src = "images/Mongolia_1.jpg";
				document.getElementById( "picture2" ).src = "images/Mongolia_2.jpg";
				document.getElementById( "picture" ).alt = "These are pictures of Mongolia.";	
				document.getElementById( "picture" ).title = "These are pictures of Mongolia.";				
			
				document.getElementById( "caption" ).innerHTML = "Mongolia - Home of the Mongol's and their nation's flag.";
}

function showSouthKorea()
{
	aArray[ 3 ] = aArray[ 3 ] + 1;
	
				document.getElementById( "picture" ).src = "images/SouthKorea_1.jpg";
				document.getElementById( "picture2" ).src = "images/SouthKorea_2.jpg";
				document.getElementById( "picture" ).alt = "These are pictures of South Korea.";	
				document.getElementById( "picture" ).title = "These are pictures of South Korea.";				
			
				document.getElementById( "caption" ).innerHTML = "South Korea - Home of booming teachnology and their nation's flag.";
}

function showTaiwan()
{
	aArray[ 4 ] = aArray[ 4 ] + 1;
	
				document.getElementById( "picture" ).src = "images/Taiwan_1.jpg";
				document.getElementById( "picture2" ).src = "images/Taiwan_2.jpg";
				document.getElementById( "picture" ).alt = "These are pictures of Taiwan.";	
				document.getElementById( "picture" ).title = "These are pictures of Taiwan.";				
			
				document.getElementById( "caption" ).innerHTML = "Taiwan - Leader's of cell phone teachnology and their nation's flag.";
}

function showCounter()
{
		
	if( aArray[ 0 ] > 0 && aArray[ 1 ] > 0 && aArray[ 2 ] > 0 
			&& aArray[ 3 ] > 0 && aArray[ 4 ] > 0 )
	{
		alert( "CONGRATULATIONS! " + aArray);
		window.location = "secondpage.html"	;
	}
	else
	{
		alert( "CHEATER--YOU DIDN'T FINISH" );
	}
}
